<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <style>
        body {
            width: 320px;
            margin: 0;
            font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            color: #333;
            max-height: 600px;
            overflow-y: auto;
            background: white;
            border-radius: 12px;
        }
        
        .container {
            display: flex;
            flex-direction: column;
            gap: 20px;
            padding: 20px;
        }
        
        /* 开关容器样式 */
        .switch-container {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            background: #f5f5f7;
            border-radius: 10px;
            margin: -4px;
        }
        
        .switch-label {
            font-size: 14px;
            font-weight: 600;
            color: #1c1c1e;
        }
        
        /* 开关按钮样式 */
        .switch {
            position: relative;
            width: 51px;
            height: 31px;
            background: #e9e9eb;
            border-radius: 15.5px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
        }
        
        .switch::before {
            content: '';
            position: absolute;
            left: 2px;
            top: 2px;
            width: 27px;
            height: 27px;
            background: #ffffff;
            border-radius: 50%;
            transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }
        
        .switch.active {
            background: #34c759;
        }
        
        .switch.active::before {
            transform: translateX(20px);
        }

        /* 修改设置按钮样式 */
        .settings-btn {
            color: #007AFF;
            background: #f0f2f5;
            border: none;
            padding: 12px 16px;
            border-radius: 10px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.2s ease;
            width: 100%;
            text-align: left;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .settings-btn::after {
            content: '›';
            font-size: 18px;
            font-weight: 300;
            transition: transform 0.2s ease;
        }

        .settings-btn:hover {
            background: #e4e7eb;
        }

        /* 设置按钮展开状态 */
        .settings-btn.active::after {
            transform: rotate(90deg);
        }

        /* 设置面板样式 */
        .settings-panel {
            display: none;
            background: #f5f5f7;
            border-radius: 10px;
            overflow: hidden;
        }

        .settings-panel.active {
            display: block;
        }

        .settings-panel h3 {
            margin: 0;
            padding: 16px;
            font-size: 14px;
            color: #1c1c1e;
            border-bottom: 1px solid #e5e5e5;
        }

        .model-list {
            max-height: 300px;
            overflow-y: auto;
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        /* 模型项样式 */
        .model-item {
            padding: 48px 16px 16px;
            position: relative;
            background: white;
            border-radius: 10px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        }

        .model-item.dragging {
            opacity: 0.9;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            background: #f8f9fa;
            transform: scale(1.02);
        }

        .model-item .drag-handle {
            position: absolute;
            left: 12px;
            top: 12px;
            color: #999;
            cursor: move;
            padding: 4px;
        }

        .model-item .drag-handle:hover {
            color: #666;
        }

        .model-item input {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid #e5e5e5;
            border-radius: 6px;
            font-size: 13px;
            transition: border-color 0.2s ease;
            box-sizing: border-box;
        }

        .model-item input:focus {
            border-color: #007AFF;
            outline: none;
        }

        .input-group {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
            margin-top: 12px;
        }

        .input-label {
            font-size: 12px;
            color: #666;
            margin-bottom: 4px;
            font-weight: 500;
        }

        /* 删除按钮样式 */
        .delete-model {
            background: #ffebeb !important;
            color: #ff3b30 !important;
            font-size: 16px !important;
            font-weight: 300;
        }

        .delete-model:hover {
            background: #ffe0e0 !important;
            color: #ff1a1a !important;
        }

        /* 添加模型按钮样式 */
        .add-model {
            background: #007AFF;
            color: white;
            border: none;
            padding: 10px 16px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            width: calc(100% - 32px);
            margin: 0 16px 16px;
            transition: background 0.2s ease;
        }

        .add-model:hover {
            background: #0066cc;
        }

        /* 保存设置按钮样式 */
        .save-settings {
            background: #34c759;
            color: white;
            border: none;
            padding: 12px 16px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            width: calc(100% - 32px);
            margin: 0 16px 16px;
            transition: background 0.2s ease;
        }

        .save-settings:hover {
            background: #30b753;
        }

        /* 修改关于区域样式 */
        .info-section {
            padding: 16px;
            background: #f5f5f7;
            border-radius: 10px;
            font-size: 13px;
            line-height: 1.5;
        }

        .info-section h3 {
            margin: 0 0 8px 0;
            font-size: 14px;
            color: #1c1c1e;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .action-links {
            margin-top: 16px;
            padding: 12px;
            background: white;
            border-radius: 8px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .link-group {
            display: flex;
            gap: 8px;
        }

        .link {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 8px 12px;
            background: #f5f5f7;
            border-radius: 6px;
            color: #1c1c1e;
            text-decoration: none;
            font-size: 13px;
            transition: all 0.2s ease;
        }

        .link:hover {
            background: #e4e7eb;
            color: #000;
        }

        /* 添加图标样式 */
        .icon {
            width: 16px;
            height: 16px;
            fill: currentColor;
        }

        /* 版本信息样式 */
        .version {
            color: #999;
            font-size: 12px;
            text-align: right;
            padding: 8px 0 0;
            border-top: 1px solid #e5e5e5;
            margin-top: 8px;
        }

        /* 滚动条样式 */
        ::-webkit-scrollbar {
            width: 8px;
            margin-right: 4px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
            margin: 4px;
        }

        ::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 4px;
            border: 2px solid white;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }

        .model-controls {
            position: absolute;
            right: 12px;
            top: 12px;
            display: flex;
            gap: 4px;
        }

        .model-controls button {
            width: 28px;
            height: 28px;
            padding: 0;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }

        .move-up, .move-down {
            background: #f0f2f5;
            color: #666;
        }

        .move-up:hover, .move-down:hover {
            background: #e4e7eb;
            color: #333;
        }

        /* 模型名称输入框样式 */
        .model-name-input {
            margin-bottom: 12px;
        }

        .model-name-input input {
            font-weight: 500;
            color: #333;
        }

        /* 移除多余的样式 */
        .model-order-controls {
            display: none;
        }

        /* 赞赏按钮样式 */
        .donate-btn {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 8px 12px;
            background: #ff9500;
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .donate-btn:hover {
            background: #ff7b00;
        }

        /* 赞赏弹窗样式 */
        .donate-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }

        .donate-modal.active {
            display: flex;
        }

        .donate-content {
            background: white;
            padding: 24px;
            border-radius: 12px;
            position: relative;
            width: 280px;
            text-align: center;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .close-btn {
            position: absolute;
            right: 12px;
            top: 12px;
            background: none;
            border: none;
            font-size: 24px;
            color: #999;
            cursor: pointer;
            padding: 4px;
            line-height: 1;
        }

        .close-btn:hover {
            color: #666;
        }

        .qr-container {
            margin: 16px 0;
            padding: 16px;
            background: #f5f5f7;
            border-radius: 8px;
        }

        .qr-code {
            width: 200px;
            height: 200px;
            object-fit: contain;
        }

        .donate-text {
            color: #666;
            margin: 0;
            font-size: 14px;
        }

        .donate-content h4 {
            margin: 0 0 16px;
            color: #1c1c1e;
            font-size: 16px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="switch-container">
            <span class="switch-label">Live2D 模型</span>
            <div id="live2dSwitch" class="switch"></div>
        </div>
        
        <button class="settings-btn" id="settingsBtn">模型设置</button>
        
        <div class="settings-panel" id="settingsPanel">
            <h3>模型配置</h3>
            <div class="model-list" id="modelList"></div>
            <button class="add-model" id="addModel">添加新模型</button>
            <button class="save-settings" id="saveSettings">保存设置</button>
        </div>
        
        <div class="info-section">
            <h3>
                <svg class="icon" viewBox="0 0 1024 1024">
                    <path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"/>
                    <path d="M512 336c-36.4 0-66 29.6-66 66s29.6 66 66 66 66-29.6 66-66-29.6-66-66-66zm0 160c-52.9 0-96 43.1-96 96v128c0 17.7 14.3 32 32 32s32-14.3 32-32V592c0-17.7 14.3-32 32-32s32 14.3 32 32v128c0 17.7 14.3 32 32 32s32-14.3 32-32V592c0-52.9-43.1-96-96-96z"/>
                </svg>
                关于插件
            </h3>
            <p>一个简单的Live2D看板娘浏览器插件，让可爱的二次元角色陪伴你的浏览时光。</p>
            
            <div class="action-links">
                <div class="link-group">
                    <a href="http://www.allfather.top" target="_blank" class="link">
                        <svg class="icon" viewBox="0 0 1024 1024">
                            <path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"/>
                            <path d="M512 336c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2C570 612.4 541.9 624 512 624s-58-11.6-79.2-32.8C411.6 570 400 541.9 400 512s11.6-58 32.8-79.2C454 411.6 482.1 400 512 400s58 11.6 79.2 32.8C612.4 454 624 482.1 624 512s-11.6 58-32.8 79.2z"/>
                        </svg>
                        作者博客
                    </a>
                    <a href="https://github.com/vita0519" target="_blank" class="link">
                        <svg class="icon" viewBox="0 0 1024 1024">
                            <path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"/>
                            <path d="M512 336c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"/>
                        </svg>
                        GitHub
                    </a>
                </div>
                <button class="donate-btn" id="donateBtn">
                    <svg class="icon" viewBox="0 0 1024 1024">
                        <path d="M673.6 452.8c-28.8-60.8-89.6-99.2-156.8-99.2-67.2 0-128 38.4-156.8 99.2-6.4 12.8 0 28.8 12.8 35.2 12.8 6.4 28.8 0 35.2-12.8 22.4-44.8 67.2-73.6 115.2-73.6s92.8 28.8 115.2 73.6c6.4 12.8 22.4 19.2 35.2 12.8 6.4-6.4 12.8-22.4 0-35.2z"/>
                    </svg>
                    赞赏作者升级优化
                </button>
            </div>
            <div class="version">版本 3.0.1</div>
        </div>
    </div>
    <script src="modelConfig.js"></script>
    <script src="popup.js"></script>
    <div class="donate-modal" id="donateModal">
        <div class="donate-content">
            <button class="close-btn" id="closeModal">×</button>
            <h4>感谢您的支持！</h4>
            <p>欢迎加入QQ交流群：738066261</p>
            <div class="qr-container">
                <img src="images/donate-qr.png" alt="赞赏二维码" class="qr-code">
            </div>
            <p class="donate-text">扫描二维码赞赏作者</p>
        </div>
    </div>
</body>
</html> 